package daa.levelup.lists;


import java.util.ArrayList;
import java.util.Iterator;
import java.util.Scanner;

public class Arrlist {
    public static void main(String[] args) {
        String arrElement;
        System.out.println("Authors ");
        Scanner sc = new Scanner(System.in);
        ArrayList<String> strList = new ArrayList<String>();

        do
        {
            arrElement = sc.nextLine();

            strList.add(arrElement);
        }
        while (strList.size() >6);
        strList.remove(3);
        strList.trimToSize();
        Iterator<String> iter = strList.iterator();
        while (iter.hasNext())
        {
            for (int i = 0; i < strList.size(); i++)
            {
                System.out.print( iter.next());

                if (i != strList.size() - 1)
                {

                    System.out.print(",");
                }
            }

        }



    }

}
